package com.millstein.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import lombok.Data;

/**
 * @description:
 * @author: tsing
 * @create: 2021-09-28 08:35
 */
@Data
public class AlipayConfig {

    public static final String FORMAT = "JSON";
    public static final String CHARSET = "utf-8";
    public static final String SIGN_TYPE = "RSA2";
    public static final String METHOD = "https://openapi.alipaydev.com/gateway.do";
    public static final String APP_ID = "2021000118622437";
    public static final String APP_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCgEZysRj611wP6A6Kz/ANUyzOYERY9U1fCjdhRvK8tzriSw29iXsL+0JF59XBDvHCI/pTyTLr/zyvyc8nUa6o61pVzmlrUJ89VLZ4JoYN2vR6TXr7eaqeEjyDc6N2fsuH6rgRnfqd1m/VkStUPvAJjslswz+gxighd3hOY6XSVOrGmDJynD5HptTFdBsZEGy/J2Z9sQAIIUq0D1NLZsnWfuh82cdNkM+9qVjwysZOUxexMF5qz4MmSH6qwf3fWIxLilLM8DD5krfz4aB8ODQcijX1UIx4J+ptCNylSGqbywu5LRNaLrPXbOsK2mHF6j1TK2y5IOZ/XUGDlEjxnirI/AgMBAAECggEAe99FTLiLvTMpO6jml7y2Yz9hrRPEDy9ZIhGdTxviwWNRyRn/L7Q/2OxVOHltKK5CtHG3mI8yw9Zynw1mKsIrGZ+IRs8z7SzlsXg87h0U3KXcbJWMxhjpjJcrCmoXYIgRg2p5tBH6y/Qmgje7DJMlkjurgGnUucmlUecTaWl5NCXa2TQFqs72M6j44SASSy97hm0W3O1v4d6YmM6K2pNLUUyA53HizTE9pZbllI/vH/W1cuTwmhnvM4cCTCxXAlb5uALhIqg0DzyT9wUmOCYhKG4ewMfVG3Y6+rpSa/qs+g3kmLFyPJUVDV95kBuuU4qDA51475EU/9fy7whBjCeakQKBgQDw1whZdTtPoWV/yxPfDMnP1jBPDFf6DMSITcy7d8OYvS+PZnsPM+r2+wQv3Bxq+5mGVJ3tJOwnriNyR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7q+/zByUv66GnzbBnqJ8Jcal+NQTRmC1ClZhLMI3zkRvGHyjEP74ZXoCmB8PgEV5T9WBKW5urScXJ0vLGhVZIR9kgRWjmlqfgK8HIqNZpiLoFGoeAiW+QavKkQr4Mo+dhXXwIDAQAB\n";

    private static volatile AlipayClient INSTANCE = null;

    public static AlipayClient getInstance() {
        if (INSTANCE == null) {
            synchronized (AlipayConfig.class) {
                if (INSTANCE == null) {
                    INSTANCE = new DefaultAlipayClient(
                            METHOD,
                            APP_ID,
                            APP_PRIVATE_KEY,
                            FORMAT,
                            CHARSET,
                            ALIPAY_PUBLIC_KEY,
                            SIGN_TYPE);
                }
            }
        }
        return INSTANCE;
    }
}
